from PIL import Image

img = Image.open('2.png')
convert = img.convert('L')
convert.save('output5.png')
